/*
 * @Author: wuqingchun
 * @Date: 2024-11-28 10:26:00
 * @Description: 日志级别类
 * @LastEditors: wuqingchun
 * @LastEditTime: 2024-11-28 10:33:50
 */
#ifndef __LOG_LEVEL_H__
#define __LOG_LEVEL_H__

#include <cstdint>

namespace LOG
{
    class CLogLevel
    {
    public:
        enum class LOG_LEVEL : uint8_t
        {
            LEVEL_DEBUG,
            LEVEL_INFO,
            LEVEL_WARN,
            LEVEL_ERROR,
            LEVEL_FATAL,
        };

        void Set(LOG_LEVEL enValue)
        {
            m_enValue = enValue;
        }

        LOG_LEVEL Get() const
        {
            return m_enValue;
        }

        const char* ToString()
        {
            static const char* apcValue[] = {
                "DEBUG",
                "INFO ",
                "WARN ",
                "ERROR",
                "FATAL",
            };

            return apcValue[(uint8_t)m_enValue];
        }
    private:
        LOG_LEVEL m_enValue = LOG_LEVEL::LEVEL_INFO;
    };

    using LOG_LEVEL = CLogLevel::LOG_LEVEL;
}

#endif //__LOG_LEVEL_H__